package com.music.muisc.services;


import com.music.muisc.dao.ForumRepository;
import com.music.muisc.entity.Forum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ForumService {

    @Autowired
    ForumRepository forumRepository;

    public List<Forum> getAll(){
        return forumRepository.findAll();
    }

    public Forum save(Forum forum){
        return forumRepository.save(forum);
    }

    public Forum findByBlogId(int theId) {
        return forumRepository.findByBlogId(theId);
    }

    public void delete(Forum theForum) {
        forumRepository.delete(theForum);
    }
}
